package com.jt.www.enums.issue;

import org.apache.commons.lang3.StringUtils;

/**
 * @author xq.wu03
 * @Classname IssueCodeEnum
 * @Description 出单公司code
 * @create 2019-10-30 15:38
 */
public enum IssueCodeEnum {
    SD_YG("0001300041", "阳光"),
    SD_YA("0001300044", "永安"),
    SD_PA("0001300049", "平安"),
    SD_RB("0001300050", "人保"),
    SD_GS("0001300051", "国寿"),
    SD_TB("0001300052", "太保"),
    SD_ZHLH("0001300053", "中华联合"),
    SD_DD("0001300048", "大地");

    /**
     * 保險公司出單code
     */
    private String code;
    private String desc;

    IssueCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static IssueCodeEnum getIssueCodeEnumByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        for (IssueCodeEnum issueCodeEnum : IssueCodeEnum.values()) {
            if (issueCodeEnum.code.equals(code)) {
                return issueCodeEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
